const connection = require('../common/configs/mysql');

const socketDao = {
    getAllIfo(func) {
        return connection.query('SELECT * FROM t_ws_list;', func);
    },
    bindWs(wsid, func) {
        return connection.query(`SELECT * FROM t_ws_list WHERE ws_id=${wsid};`, func);
    },
    addWs(ws, wsid, func) {
        return connection.query(`INSERT INTO t_ws_list (ws,ws_id) VALUES('${ws}','${wsid}');`, func);
    },
    updeteWs(ws, wsid, func) {
        return connection.query(`UPDATE t_ws_list SET ws='${ws}' where ws_id='${wsid}';`, func);
    },
    delWs(wsid, func) {
        return connection.query(`delete from t_ws_list where ws_id='${wsid}';`, func);
    }
}


module.exports = socketDao;